package com.thz.houserental.infrastructure.auth;

import org.springframework.security.core.context.SecurityContextHolder;

public final class AuthUtil {
    public static String getCurrentUserId() {
        return getUserDetail().getUser().getId();
    }
    
    private static UserDetail getUserDetail() {
        return (UserDetail) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
